//package com.binguo.thirdPay.xinDaPay;
//
//import com.alibaba.fastjson.JSON;
//import com.alibaba.fastjson.JSONObject;
//import com.binguo.common.exception.ServiceException;
//import com.binguo.common.util.Base64Util;
//import org.apache.axis.client.Service;
//import org.apache.axis.encoding.XMLType;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//
//
//import javax.xml.namespace.QName;
//import javax.xml.rpc.Call;
//import javax.xml.rpc.ParameterMode;
//import java.text.SimpleDateFormat;
//import java.util.Date;
//
///**
// * @author yuritian
// * @Title: XinDaPayService
// * @ProjectName binguoDevelop
// * @Description: TODO
// * @date 2020/5/915:02
// */
//@org.springframework.stereotype.Service
//public class XinDaPayService {
//
//    private static Logger logger = LoggerFactory.getLogger(XinDaPayService.class);
//
//    public static void main(String[] args) {
//        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss");
//        XinDaPayService xinDaPayService = new XinDaPayService();
//        XinDaPayVO payVO = new XinDaPayVO();
//        payVO.setTxamt("1");
//        payVO.setMeraccno("243001188");
//        payVO.setStationcode("0057");
//        payVO.setTxdate(dateFormat.format(new Date()));
//        payVO.setPoscode("5032");
//        payVO.setPosjourno("YunpengTest");
//        xinDaPayService.xinDaPay(payVO,"");
//    }
//
//    public JSONObject xinDaPay(XinDaPayVO payVO,
//                         String codecontent){
//        String jsonStr = JSONObject.toJSONString(payVO);
//        JSONObject param = JSON.parseObject(jsonStr);
//        param.put("codecontent",codecontent);
//        logger.info("新大发送数据:"+ param.toJSONString());
//        return doSelectRiskReportForm(param.toJSONString());
//    }
//
//
//    public JSONObject doSelectRiskReportForm(String param){
//        //调用接口
//        //方法一:直接AXIS调用远程的web service
//        try {
//            String endpoint = "http://111.115.76.14:8080/TransferService/services/ICardService";
//            Service service = new Service();
//            Call call = service.createCall();
//            call.setTargetEndpointAddress(endpoint);
//            // 参数名//对应的是 public String printWord(@WebParam(name = "settle_num") String settle_num);
//            String parametersName = "in0";
//            // 调用的方法名//当这种调用不到的时候,可以使用下面的,加入命名空间名
//            call.setOperationName(QName.valueOf("receiveFromThird"));
//            //参数名//XSD_STRING:String类型//.IN入参
//            call.addParameter(parametersName, XMLType.XSD_STRING, ParameterMode.IN);
//            // 返回值类型：String
//            call.setReturnType(XMLType.XSD_STRING);
//            param = Base64Util.encode(param.getBytes());
//            // 远程调用
//            String result = (String) call.invoke(new Object[] { param });
//            logger.info(new String(Base64Util.decode(result)));
//            JSONObject resultObject = JSONObject.parseObject(new String(Base64Util.decode(result)));
//            return resultObject;
//        } catch (Exception e) {
//            logger.error(e.toString());
//            throw new ServiceException("支付失败,服务器异常");
//        }
//    }
//}
